
<!DOCTYPE html>
<html lang="zh" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>在线支付</title>
    <link rel="stylesheet" type="text/css" href="http://q.taoxueqian.com/need/layer.css" />
    <link rel="stylesheet" type="text/css" href="http://q.taoxueqian.com/kuaijiepay1.2.css" />
</head>
<body>
<div class="main-container">
<div id="logo"><img id="logo-img" src="http://q.taoxueqian.com/wxpay.jpeg" width="80%"></div>
<div id="orderPriceBody">打赏金额 ￥<span id='orderPrice'>{$money}</span></div>
<div id="orderNo">订单号：{$billNo}</div>
<div class="desc">如果长时间无法跳转，请在<span style="color: blue">已购</span>中查看</div>
<div id='qrCode'><div class="qrcontainer"><img class="div-qrcode" src="https://api.pwmqr.com/qrcode/create/?url={$payCode}"></div></div>
<div id="tipIcon"><svg t="1564880449981" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="524" width="48" height="48"><path d="M823.174 397.898h-2.431c-17.909 0-32.599 5.137-46.742 13.903-12.397-36.127-43.9-62.153-84.48-62.153-17.909 0-35.031 5.137-49.174 13.903-12.397-36.127-43.9-62.153-84.514-62.153-15.821 0-30.545 3.972-43.558 10.924v-92.972c0-50.646-38.319-91.67-89.308-91.67-50.99 0-92.355 41.058-92.355 91.67v355.931l-56.058-55.853c-36.059-35.819-99.889-30.717-130.606 0s-50.852 92.493-6.883 136.495l257.924 256.213c5.308 5.274 11.163 9.691 17.327 13.424 47.017 38.353 100.916 61.057 214.845 61.057 260.287 0 284.394-140.434 284.394-313.638v-183.376c-0.033-50.646-37.359-91.705-88.382-91.705M862.897 672.943c0 146.563-0.686 265.39-235.769 265.39-99.581 0-159.371-22.19-204.675-67.187l-244.158-242.549c-21.607-21.607-16.162-49.209 1.507-66.913 17.669-17.669 50.132-18.286 67.22-1.335 0 0 42.839 42.565 79.754 79.275 27.908 27.772 52.461 52.154 52.461 52.154v-462.77c0-23.97 19.587-43.421 43.763-43.421s40.682 19.451 40.682 43.421v294.359h0.479c-0.304 1.459-0.479 3.136-0.479 4.854 0 13.296 10.89 24.116 24.313 24.116s24.313-10.786 24.313-24.141c0-1.644-0.172-3.252-0.479-4.829h0.479v-120.641c0-23.971 17.465-43.421 41.641-43.421 0 0 42.804-0.581 42.804 43.421v159.233h0.479c-0.304 1.459-0.479 3.136-0.479 4.853 0 13.295 10.89 24.115 24.313 24.115s24.313-10.786 24.313-24.141c0-1.644-0.172-3.252-0.479-4.828h0.479v-110.983c0-23.97 17.19-43.421 41.366-43.421 0 0 43.695 2.739 43.695 43.421v139.954h0.479c-0.304 1.459-0.479 3.136-0.479 4.854 0 13.296 10.89 24.116 24.313 24.116s23.697-10.786 23.697-24.141c0-1.644-0.172-3.252-0.446-4.829h0.446v-95.54c0-23.971 18.013-43.421 42.189-43.421 0 0 42.359-1.713 42.359 43.421v177.554h-0.1M294.554 356.051v-81.055c-7.706-17.293-12.087-36.435-12.087-56.571 0-76.844 62.289-139.133 139.133-139.133s139.133 62.289 139.133 139.133c0 10.479-1.232 20.684-3.459 30.511 17.499 0.686 33.285 7.945 44.79 19.621 4.451-15.957 7.088-32.703 7.088-50.099 0-103.553-83.966-187.519-187.519-187.519s-187.519 83.966-187.519 187.519c-0.035 54.448 23.319 103.347 60.441 137.591M294.554 356.051z" p-id="525"></path></svg></div>
<div id="tip">长按识别二维码付款</div>
<div id='countDown'></div>
<div class="desc">支付完成后，请耐心等待3-30秒即可跳转</div>
<div class="desc">如遇“<span style="color: blue">风险提示</span>”请点“<span style="color: green">继续支付</span>”</div>
<div id="qrtip" class="qr-tip" style="display: none;" onclick="this.style.display = 'none'"><img src="http://q.taoxueqian.com/qr-tip.jpg" onclick="event.stopPropagation()"><button>知道了</button></div>
<button id="copyBtn" class="copyBtn" data-clipboard-text="3.00" data-clipboard-action="copy" style="display: none;"></button>
</div>
<script src="https://cdn.staticfile.org/jquery/3.4.0/jquery.min.js"></script>
<script src="http://q.taoxueqian.com/clipboard.min.js"></script>
<script src="http://q.taoxueqian.com/layer.js"></script>
<script src="http://webh.zgrjkf.com/static/aicaipay/resouce/js/jquery.min.js"></script>
<script src="//cdn.bootcss.com/layer/2.3/layer.js"></script>
<script>

    function back() {
        window.location.href = "<?php echo $url; ?>";
    }

    var isAnyCode = false;
    var infoOrderPrice = "<?php echo $money; ?>";
    $("#copyBtn").attr("data-clipboard-text", infoOrderPrice);
    var clipboard = new ClipboardJS('#copyBtn');
    clipboard.on('success', function(e) {
        layer.open({
            content: '复制成功：'+infoOrderPrice
            ,skin: 'msg'
            ,time: 1 // 1秒后自动关闭
        });
    });
    clipboard.on('error', function(e) {
        layer.open({
            title: '提示',
            content: '您的浏览器可能不支持，请手动复制~'
        });
    });

    // 查询订单状态
    // var orderno = "qwqq10141638612527625hejgzl";

    var billNo = "{$billNo}";
    
    function checkPayStatus() {
        try {
            $.get("{:url('pay/checkorder')}",{billNo:billNo}, function (result) {
                if (result.code == 1) {
                    // 支付成功后跳转
                    layer.confirm(result.msg, {
                    icon: 1,
                    title: '支付成功！',
                    btn: ['我知道了'] //按钮
                    }, function () {
                        back();
                    });
                    
                } else {
                    setTimeout(checkPayStatus, 1000);
                    
                    
                    
                }
            });
        } catch(err) {}
    }

    $(document).ready(function(){
        var isWeChat = /windowswechat|MicroMessenger/i.test(navigator.userAgent);
        if (!isWeChat) {
            document.getElementById('qrtip').style.display = 'flex'
            $('#tip').html('截图二维码微信扫码付款');
        } else if (isAnyCode) {
            layer.open({
                content: '长按识别二维码，输入正确金额（<strong style=\'font-size: large; color: red;\'>'+infoOrderPrice+'</strong>），不能输错金额哦！付款成功后请手动点击左上角关闭支付页面即可观看'
                ,btn: '郑知道了'
                ,end: function(){
                    $('#copyBtn').click();
                }
            });
        }
        setTimeout(checkPayStatus, 1000);
    });
    
    var second = 0;
    var csdsq = setInterval(function(){
    	second++;
    	var showtime = '';
    	if(90-second>60){
    	    var miao = (90-second-60);
    	    if(miao<10){
    	        miao = '0'+miao;
    	    }
    	    showtime = '1:'+miao;
    	}else{
    	    showtime='0:'+(90-second);
    	}
    	$('#djs').html(showtime);
    	if(second>=90){
    	    clearInterval(csdsq);
    		layer.confirm('订单已失效，请重新发起支付！', {
                    icon: 1,
                    title: '订单失效！',
                    btn: ['我知道了'] //按钮
                }, function () {
    				<!-- 如有特殊需要请手动修改跳转地址 （订单失效之后的跳转地址 可以设置为您网站的主页 或者支付前的页面） -->
    				//比如想跳转 http://www.baidu.com 修改为 location.href = "http://www.baidu.com";
                    location.reload();<!-- 如有特殊需要请手动修改跳转地址 （订单失效之后的跳转地址 可以设置为您网站的主页 或者支付前的页面） -->
    				<!-- 如有特殊需要请手动修改跳转地址 （订单失效之后的跳转地址 可以设置为您网站的主页 或者支付前的页面） -->
             });
    	}
    }, 1000);
</script>
</body>
</html>